<?php if (!defined('THINK_PATH')) exit(); session_start(); ?>
<!DOCTYPE html>
<html>
<!--Made By kailuosoft.com, TEL 171 9992 9517 -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>产品销售统计</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="/Public/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/Public/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/Public/css/animate.min.css" rel="stylesheet">
    <link href="/Public/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="/Public/css/page.css" rel="stylesheet">
    <link href="/Public/css/new.css" rel="stylesheet">

    <script src="/Public/js/jquery.min63b9.js?v=2.1.4"></script>
    <script type="text/javascript" src="/Public/js/jquery.imgbox.pack.js"></script>
    <script src="/Public/js/plugins/layer/layer.min.js"></script>
    <style>br {
        mso-data-placement: same-cell;
        white-space: normal;
    } </style>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

</head>
<body class="gray-bg" style="width:1400px; height:100%;overflow:scroll;position:absolute;">
<frame>
<div style="position:relative;">
    <img src="/Public/images/<?php echo ($product_info["sku"]); ?>/<?php echo ($product_info["main_pic"]); ?>" id="main_pic_show"
         style="position:fixed;z-index:1;display:none;"/>
    <img src="/Public/images/<?php echo ($product_info["sku"]); ?>/<?php echo ($product_info["size_pic"]); ?>" id="size_pic_show"
         style="position:fixed;z-index:1;display:none;"/>

</div>
<div class="wrapper wrapper-content fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>产品销售统计</h5>


                </div>

                <table class="table table-bordered table-striped table-hover" height="100%">
                    <thead>
                    <tr>
                        <th width="1%"><input class="check-all" type="checkbox" value=""/></th>
                        <th width="12%">SKU</th>
                        <th width="10%">主图</th>
                        <th width="5%">产品开发人员</th>
                        <th width="5%">产品类型</th>
                        <th width="10%">品牌</th>
                        <th width="10%">自主订货产品</th>
                        <th width="10%">供应商</th>
                        <th width="10%">销售总数量</th>
                        <th width="5%">成本价 <br>单位:￥</th>
                        <th width="5%">实际销售总金额 <br>单位:$</th>
                        <th width="12%">统计时间</th>
                        <th width="12%">产品创建时间</th>
                        <th width="5%">操作</th>
                    </tr>
                    </thead>
                    <form id="searchForm" class="form-inline" method="get" action="">
                        <input type="hidden" value="1" name="pageNo">
                        <input type="hidden" value="10" name="pageSize">
                        
                        <br>
                        
                        <!-- <input type="checkbox" name="req"  value="0" <?php if($_SESSION['req']==0){ ?> checked="checked" <?php } ?>>勾选显示30天数据 -->
                        
                        <input type="radio" name="req" value="0" <?php if($_SESSION['req']==0){ ?> checked="checked" <?php } ?> >30内记录
                        <input type="radio" name="req" value="1" <?php if($_SESSION['req']==1){ ?> checked="checked" <?php } ?> >所有记录
                        <br>
                        <thead>
                        <tr>
                            <th></th>
                            <th><input type="text" class="input-sm form-control" name="sku" value="<?php echo ($sku); ?>"></th>
                            <th></th>
                            <th><input type="text" class="input-sm form-control" name="product_dev" value="<?php echo ($product_dev); ?>"></th>
                            <th><input type="text" class="input-sm form-control" name="product_type" value="<?php echo ($product_type); ?>"></th>
                            <th></th>
                            <th><input type="text" class="input-sm form-control" name="own_product" value="<?php echo ($own_product); ?>"></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>

                            <!-- 统计时间  -->
                            <th>

                                <input placeholder="开始时间" name="delivery_time_start" id="delivery_time_start"
                                       onClick="laydate({istime: true, format: 'YYYY-MM-DD'})"
                                       value="<?php if($delivery_time_start != null): echo ($delivery_time_start); endif; ?>"
                                       class="input-sm form-control">

                                <input placeholder="结束时间" name="delivery_time_end" id="delivery_time_end"
                                       onClick="laydate({istime: true, format: 'YYYY-MM-DD'})"
                                       value="<?php if($delivery_time_end != null): echo ($delivery_time_end); endif; ?>"
                                       class="input-sm form-control">
                            </th>


                            <!-- 产品创建时间  -->
                            <th>

                                <input placeholder="开始时间" name="add_time_start" id="add_time_start"
                                       onClick="laydate({istime: true, format: 'YYYY-MM-DD'})"
                                       value="<?php if($add_time_start != null): echo ($add_time_start); endif; ?>"
                                       class="input-sm form-control">

                                <input placeholder="结束时间" name="add_time_end" id="add_time_end"
                                       onClick="laydate({istime: true, format: 'YYYY-MM-DD'})"
                                       value="<?php if($add_time_end != null): echo ($add_time_end); endif; ?>"
                                       class="input-sm form-control">
                            </th>

                            <!-- 操作  -->
                            <th>
                                <button type="button" class="btn btn-sm btn-primary" id="search"> 搜索</button>
                                
                                <a class="btn btn-sm btn-primary" title="导出" id="import">导出</a>
                            </th>
                        </tr>
                        </thead>
                    </form>

                    <!-- 读取数据并循环输出  -->
                    <form id="product_management" method="post" action="" enctype="multipart/form-data">
                        <tbody class="tbody">
                        <?php if(is_array($products)): foreach($products as $k=>$product_info): ?><tr>
                                <td><input class="i-checks" type="checkbox" name="ids" value="<?php echo ($product_info["id"]); ?>"/></td>
                                <td><?php echo ($product_info["sku"]); ?></td>
                                <td>
                                    <img src="/Public/images/<?php echo ($product_info["sku"]); ?>/<?php echo ($product_info["main_pic"]); ?>"
                                         alt="图片已丢失或不存在" height="120px" width="120px" class="main_pic"
                                         style="z-index:-1;"/>
                                </td>
                                <td>
                                    <?php echo ($product_info["product_dev"]); ?>
                                </td>
                                <td>
                                    <?php echo ($product_info["product_type"]); ?>
                                </td>
                                <td>
                                    <?php echo ($product_info["brand"]); ?>
                                </td>
                                <th>
                                    <?php echo ($product_info["own_product"]); ?>
                                </th>
                                <td>
                                    <?php echo ($product_info["supplier"]); ?>
                                </td>
                                <td>
                                    <?php echo ($product_info["sale_num"]); ?>
                                </td>
                                <td>
                                    <?php echo ($product_info["cost_price"]); ?>
                                </td>
                                <td>
                                    <?php echo ($product_info["sale"]); ?>
                                </td>
                                <td>
                                    <?php echo ($product_info["delivery_time"]); ?>
                                </td>
                                <td>
                                    <?php echo ($product_info["addtime"]); ?>
                                </td>
                                <td>

                                </td>
                            </tr><?php endforeach; endif; ?>
                        </tbody>
                </table>
                </form>
                <br/>

                <!-- 分页代码 -->
                <div class="fixed-table-pagination" style="display: block;margin-top:30px;">
                    <div class="pull-left pagination-detail">
                        <span class="pagination-info">显示第 1 到第 <?php echo ($count["pageSize"]); ?> 条记录，总共 <?php echo ($count["count"]); ?> 条记录</span>
                        <span class="page-list">每页显示
			<span class="btn-group dropup">
				<button type="button" class="btn btn-default  btn-outline dropdown-toggle" data-toggle="dropdown"
                        aria-expanded="false">
					<span class="page-size"><?php echo ($count["pageSize"]); ?></span> <span class="caret"></span></button>
					<ul class="dropdown-menu" role="menu">
					<li class="<?php if( $count["pageSize"] == 10): ?>active<?php endif; ?>"><a
                            href="javascript:page(1,10,'');">10</a></li>
                        <li class="<?php if( $count["pageSize"] == 25): ?>active<?php endif; ?>"><a
                            href="javascript:page(1,25,'');">25</a></li>
                        <li class="<?php if( $count["pageSize"] == 50): ?>active<?php endif; ?>"><a
                            href="javascript:page(1,50,'');">50</a></li>
                        <li class="<?php if( $count["pageSize"] == 100): ?>active<?php endif; ?>"><a
                            href="javascript:page(1,100,'');">100</a></li>
					</ul>
					</span> 条记录</span>
                    </div>
                    <div class=" pagination-roll"><!--pull-right-->
                        <ul class="pagination pagination-outline" style="float:left;">
                            <li class="paginate_button <?php if( $count["pageNo"] == 1 ): ?>previous disabled<?php endif; ?>"><a href="javascript:" onClick="page(1,<?php echo ($count["pageSize"]); ?>,'');"><i
                                class="fa fa-angle-double-left"></i></a></li>
                            <li class="paginate_button <?php if( $count["pageNo"] == 1 ): ?>previous disabled<?php endif; ?>"><a href="javascript:"
                                                           onClick="page(<?php echo ($count["pageNo"]); ?>-1,<?php echo ($count["pageSize"]); ?>,'');"><i
                                class="fa fa-angle-left"></i></a></li>
                            <?php if( $count["countpage"] > 10 ): if( $count["pageNo"] < 5 ): ?><li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(1,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id="<?php echo ($count['pageNo']==1)?'current':'' ?>">1</a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(2,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id="<?php echo ($count['pageNo']==2)?'current':'' ?>">2</a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(3,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id="<?php echo ($count['pageNo']==3)?'current':'' ?>">3</a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(4,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id="<?php echo ($count['pageNo']==4)?'current':'' ?>">4</a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(5,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id="<?php echo ($count['pageNo']==5)?'current':'' ?>">5</a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(6,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id="<?php echo ($count['pageNo']==6)?'current':'' ?>">6</a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(7,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id="<?php echo ($count['pageNo']==7)?'current':'' ?>">7</a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(8,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id="<?php echo ($count['pageNo']==8)?'current':'' ?>">8</a>
                                    </li>
                                    <li class="paginate_button disabled"><a href="javascript:">...</a></li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo ($count["countpage"]); ?>,<?php echo ($count["pageSize"]); ?>,'');"><?php echo ($count["countpage"]); ?></a>
                                    </li>
                                    <?php elseif($count["pageNo"] < $count["num"] and $count["pageNo"] >= 5): ?>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(1,<?php echo ($count["pageSize"]); ?>,'');">1</a></li>
                                    <li class="paginate_button disabled"><a href="javascript:">...</a></li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo $count['pageNo']-3; ?>,<?php echo ($count["pageSize"]); ?>,'');"><?php echo $count['pageNo']-3; ?></a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo $count['pageNo']-2; ?>,<?php echo ($count["pageSize"]); ?>,'');"><?php echo $count['pageNo']-2; ?></a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo $count['pageNo']-1; ?>,<?php echo ($count["pageSize"]); ?>,'');"><?php echo $count['pageNo']-1; ?></a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo ($count["pageNo"]); ?>,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id='current'><?php echo $count['pageNo']; ?></a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo $count['pageNo']+1; ?>,<?php echo ($count["pageSize"]); ?>,'');"><?php echo $count['pageNo']+1; ?></a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo $count['pageNo']+2; ?>,<?php echo ($count["pageSize"]); ?>,'');"><?php echo $count['pageNo']+2; ?></a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo $count['pageNo']+3; ?>,<?php echo ($count["pageSize"]); ?>,'');"><?php echo $count['pageNo']+3; ?></a>
                                    </li>
                                    <li class="paginate_button disabled"><a href="javascript:">...</a></li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo ($count["countpage"]); ?>,<?php echo ($count["pageSize"]); ?>,'');"><?php echo ($count["countpage"]); ?></a>
                                    </li>
                                    <?php else: ?>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(1,<?php echo ($count["pageSize"]); ?>,'');">1</a></li>
                                    <li class="paginate_button disabled"><a href="javascript:">...</a></li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo $count['countpage']-4; ?>,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id="<?php echo ($count['pageNo']==($count['countpage']-4))?'current':'' ?>"><?php echo $count['countpage']-4; ?></a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo $count['countpage']-3; ?>,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id="<?php echo ($count['pageNo']==($count['countpage']-3))?'current':'' ?>"><?php echo $count['countpage']-3; ?></a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo $count['countpage']-2; ?>,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id="<?php echo ($count['pageNo']==($count['countpage']-2))?'current':'' ?>"><?php echo $count['countpage']-2; ?></a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo $count['countpage']-1; ?>,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id="<?php echo ($count['pageNo']==($count['countpage']-1))?'current':'' ?>"><?php echo $count['countpage']-1; ?></a>
                                    </li>
                                    <li class="paginate_button "><a href="javascript:"
                                                                    onClick="page(<?php echo $count['countpage']; ?>,<?php echo ($count["pageSize"]); ?>,'');"
                                                                    id="<?php echo ($count['pageNo']==$count['countpage'])?'current':'' ?>"><?php echo $count['countpage']; ?></a>
                                    </li><?php endif; ?>
                                <?php else: ?>
                                <?php $__FOR_START_1601146423__=0;$__FOR_END_1601146423__=$count["countpage"];for($i=$__FOR_START_1601146423__;$i < $__FOR_END_1601146423__;$i+=1){ ?><li class="paginate_button <?php if( $count["pageNo"] == $i+1 ): ?>previous disabled<?php endif; ?>
                            "><a href="javascript:" onClick="page(<?php echo ($i+1); ?>,<?php echo ($count["pageSize"]); ?>,'');"
                                 id="<?php echo ($count['pageNo']==($i+1))?'current':'' ?>"><?php echo ($i+1); ?></a></li><?php } endif; ?>
                            <li class="paginate_button next <?php if( $count["pageNo"] >= $count["countpage"] ): ?>previous disabled<?php endif; ?>"><a href="javascript:"
                                                           onClick="page(<?php echo ($count["pageNo"]); ?>+1,<?php echo ($count["pageSize"]); ?>,'');"><i
                                class="fa fa-angle-right"></i></a></li>
                            <li class="paginate_button next <?php if( $count["pageNo"] >= $count["countpage"] ): ?>previous disabled<?php endif; ?>"><a href="javascript:"
                                                           onClick="page(<?php echo ($count["countpage"]); ?>,<?php echo ($count["pageSize"]); ?>,'');"><i
                                class="fa fa-angle-double-right"></i></a></li>
                        </ul>
                        <div>
                    </div>

                </div>
                <br/>
                <br/>
            </div>
        </div>
    </div>

</div>
</div>
</div>

</div>

</div>
<script src="/Public/js/jquery.min63b9.js?v=2.1.4"></script>
<script src="/Public/js/bootstrap.min14ed.js?v=3.3.6"></script>
<script src="/Public/js/plugins/peity/jquery.peity.min.js"></script>
<script src="/Public/js/content.mine209.js?v=1.0.0"></script>
<script src="/Public/js/plugins/iCheck/icheck.min.js"></script>
<script src="/Public/js/demo/peity-demo.min.js"></script>
<script src="/Public/js/plugins/layer/laydate/laydate.js"></script>
<script>
    $(document).ready(function () {
        $(".i-checks").iCheck({checkboxClass: "icheckbox_square-green", radioClass: "iradio_square-green",});
        $('.check-all').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
        $('.check-all').on('ifChecked', function (event) { //ifCreated 事件应该在插件初始化之前绑定
            $('.i-checks').iCheck('check');
        });

        $('.check-all').on('ifUnchecked', function (event) { //ifCreated 事件应该在插件初始化之前绑定
            $('.i-checks').iCheck('uncheck');
        });


        $('#edit_productAll').click(function () {
            tids = '';
            $('.i-checks').each(function () {
                if ($(this).prop('checked')) {
                    tids += $(this).val() + ',';
                }
            })
            if (tids == '') {
                layer.alert('请选择产品');
                return false
            }
            $(this).attr('href', 'edit_productAll?tids=' + tids);

        })

        $(".main_pic").click(function () {
            $("#main_pic_show").css({
                width: "40%",
                height: "auto",
                display: "block",
                padding: "10px",
                top: "46px",
                left: "445px"
            });
            //z-index: 92; padding: 10px; top: 46px; left: 445px; width: 500px; height: 333px; display: block;
            var path = $(this).attr("src");
            $("#main_pic_show").attr('src', path);
        })

        $("#main_pic_show").click(function () {
            $("#main_pic_show").css({width: "40%", height: "auto", display: "none"});
        })

        $(".size_pic").click(function () {
            $("#size_pic_show").css({
                width: "40%",
                height: "auto",
                display: "block",
                padding: "10px",
                top: "46px",
                left: "445px"
            });
            var path = $(this).attr("src");
            $("#size_pic_show").attr('src', path);
        })

        $("#size_pic_show").click(function () {
            $("#size_pic_show").css({width: "40%", height: "auto", display: "none"});
        });

        // 搜索
        $('#search').click(function(){
            $('input[name="pageNo"]').val(1);
            $('input[name="pageSize"]').val(10);
            $("#searchForm").submit();
        });

        // 导出
        $('#import').click(function() {
            var query = $("#searchForm").serialize();
            window.location.href = "import_sale_stat?" + query;
        });

    });

    function page(page, pageSize) {
        $('input[name="pageNo"]').val(page);
        $('input[name="pageSize"]').val(pageSize);
        $("#searchForm").submit();
    }
</script>
<div style="display:none">
    <script language="javascript" type="text/javascript" src="http://js.users.51.la/17825721.js"></script>
    <noscript><a href="http://www.51.la/?17825721" target="_blank"><img
            alt="&#x6211;&#x8981;&#x5566;&#x514D;&#x8D39;&#x7EDF;&#x8BA1;" src="http://img.users.51.la/17825721.asp"
            style="border:none"/></a></noscript>
</div>
<frame>
</body>
<!--Made By kailuosoft.com, TEL 171 9992 9517 -->
<script type="text/javascript" src="http://g.tbcdn.cn/sj/securesdk/0.0.3/securesdk_v2.js" id="J_secure_sdk_v2"
        data-appkey="23416550"></script>
</html>